varying vec4 g_Position;
varying vec4 w_Position;

void main() {
    vec3 red = vec3(1.0, 0.0, 0.0);
    vec3 yellow = vec3(1.0, 1.0, 0.0);
    vec3 mixColor = mix(yellow, red, g_Position.y - 0.7);//和物体局部空间坐标y值有关

    if(gl_FrontFacing) {
        gl_FragColor = vec4(mixColor - w_Position.y / 80.0, 1.0);//和世界坐标y值有关
    } else {
        gl_FragColor = vec4(mixColor, 1.0);
    }

}